/**
 * Copyright (c) Freelens Authors. All rights reserved.
 * Copyright (c) OpenLens Authors. All rights reserved.
 * Licensed under MIT License. See LICENSE in root directory for more information.
 */

.ClusterManager {
  --hotbar-width: 75px;

  display: grid;
  grid-template-areas:
    "topbar topbar"
    "menu main"
    "status-bar status-bar";
  grid-template-rows: auto 1fr min-content;
  grid-template-columns: min-content 1fr;

  &.hotbarAutoHide {
    grid-template-areas:
      "topbar"
      "main"
      "status-bar";
    grid-template-columns: 1fr;
  }

  main {
    grid-area: main;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .HotbarMenu {
    grid-area: menu;

    &.autoHide {
      position: fixed;
      left: 0;
      top: var(--main-layout-header);
      bottom: var(--status-bar-height);
      z-index: 2;
    }
  }

  .hotbar-trigger-zone {
    position: fixed;
    left: 0;
    top: var(--main-layout-header);
    bottom: var(--status-bar-height);
    width: 15px;
    z-index: 10;
    pointer-events: auto;
  }

  .error {
    z-index: 1;
  }

  #lens-views {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    background-color: var(--mainBackground);
    z-index: 1;

    iframe {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      display: flex;
      flex: 1;

      // when updating font settings in the "Preferences -> Terminal" cluster's iframe
      // must be accessible in DOM (e.g. elem.getBoundingClientRect() must work)
      &.hidden {
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
      }
    }
  }
}
